import React, {Component} from 'react';
import {Text, View, StyleSheet, TouchableOpacity} from 'react-native';


class Index extends Component {

  static defaultProps = {
    onPress: () => {}
  }

  constructor(props) {
    super(props);
  }

  onPressButton(){
    if (this.props.onPress){
      this.props.onPress()
    }else {

    }
  }

  render() {
    return (
		<TouchableOpacity style={{ width: "100%", height: "100%" }} onPress={this.onPressButton.bind(this)}>
        <View style={styles.button}>
          <Text style={styles.buttonText}>{this.props.children}</Text>
        </View>
      </TouchableOpacity>
    );
  }
}

const styles = StyleSheet.create({
  button: {
    backgroundColor: '#007bff',
    paddingVertical: 10,
    paddingHorizontal: 20,
    borderRadius: 5,
    alignItems: 'center',
  },
  buttonText: {
    color: '#ffffff',
    fontSize: 16,
  },
});

export default Index;
